package com.ferryc.commons.entity;

import java.io.Serializable;

public class TreeNode implements Serializable {

	/** 菜单默认 icon */
	public static final String MENU_DEFAULT_ICON = "fa fa-list";

	/** requiredparent */
	private String id;
	/** node text */
	private String text;
	/** string for custom */
	private String icon;
	/** */
	private stateClass state = new stateClass();
	/** */
	private Object children;

	private String label;

	public class stateClass {
		/** is the node open */
		private boolean opened = Boolean.TRUE;
		/** is the node disabled */
		private boolean disabled = Boolean.FALSE;
		/** is the node selected */
		private boolean selected = Boolean.FALSE;

		public boolean isOpened() {
			return opened;
		}

		public void setOpened(boolean opened) {
			this.opened = opened;
		}

		public boolean isDisabled() {
			return disabled;
		}

		public void setDisabled(boolean disabled) {
			this.disabled = disabled;
		}

		public boolean isSelected() {
			return selected;
		}

		public void setSelected(boolean selected) {
			this.selected = selected;
		}
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getIcon() {
		if (null == this.icon) {
			if (null != children) {
				return "fa fa-sitemap";
			}
			return "fa fa-database";
		}
		return this.icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public stateClass getState() {
		return state;
	}

	public void setState(stateClass state) {
		this.state = state;
	}

	public Object getChildren() {
		return children;
	}

	public void setChildren(Object children) {
		this.children = children;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

}
